﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using U.B.ErrorCode;
using U.B.ReadApi.Command;
using U.B.ReadApi.Dto;

namespace U.B.ReadApi.Controllers
{
    [Route("api/[controller] / [action]")]
    [ApiController]
    public class DepUserController : ControllerBase
    {
        private readonly IMediator _mediator;

        public DepUserController(IMediator mediator)
        {
            _mediator = mediator;
        }
        /// <summary>
        /// 获取部门
        /// </summary>
        /// <param name="command"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<ApiResult<List<DepartmentUserDto>>>GetDepartmentUsers([FromQuery] DepartmentUserCommand command)
        {
            return _mediator.Send(command);
        }
    }
}
